//
//  SEGTextCell.h
//  YYKitDemo
//
//  Created by 刘山 on 2017/11/7.
//  Copyright © 2017年 Sam. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SEGSideslipView.h"
#import "SEGNewMyDoorListModel.h"

@protocol SEGTextCellDelegate <NSObject>
@optional
-(void)seg_canOpenDoor:(BOOL)canOpen IndexPath:(NSIndexPath*)indexPath Event:(NSString *)event;
-(void)seg_doorFix;
-(void)seg_CellClickAtIndexPath:(NSIndexPath*)indexPath;
-(void)seg_CellSwitch:(BOOL)isOn;
@end

typedef NS_ENUM(NSUInteger, SEGEnumCellShowType) {
    SEGEnumShowType_Title = 0, /*标题*/
    SEGEnumShowType_Content = 1, /*内容*/
    SEGEnumShowType_Fix = 2, /*报修按钮显示*/
    SEGEnumShowType_ShowNotice = 3, /*开门提示音*/
    SEGEnumShowType_NoticeArea = 4, /*提示音地区*/
    SEGEnumShowType_OpenDoor = 5 /*侧滑开门cell*/
};

@interface SEGDoorTextLayout : NSObject
@property (nonatomic, copy) NSString *content;
@property (nonatomic, assign) SEGEnumCellShowType type;

@property (nonatomic, assign) CGFloat contentHeight;
@property (nonatomic, strong)SEGTextLayout *contentLayout;

@property (nonatomic, assign) CGFloat height;

- (instancetype)initWithContent:(NSString*)content ShowType:(SEGEnumCellShowType)type;
- (instancetype)initWithData:(SEGNewMyDoorListModel*)data ShowType:(SEGEnumCellShowType)type;
- (instancetype)initWithContent:(NSString*)content ShowType:(SEGEnumCellShowType)type activity:(NSString*)activity;
@property (nonatomic, strong)SEGNewMyDoorListModel *data;
@end

@interface SEGTextCell : UITableViewCell<SEGSideslipViewDelegate>
@property(nonatomic, weak) id<SEGTextCellDelegate> delegate;
@property (nonatomic, strong)NSIndexPath *indexPath;
@property (nonatomic, strong) SEGLabel *contentLabel;
@property (nonatomic, strong) UIImageView *titleImageView;
@property (nonatomic, strong) UIButton *submitButton;
@property (nonatomic, strong) UISwitch *switchButton;
@property (nonatomic, strong)SEGSideslipView *doorView;

- (void)setLayout:(SEGDoorTextLayout *)layout;
@end

